/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#include "BuilderExecutor.h"
#include "GameBuilder.h"

namespace PQBuilder
{
	BuilderExecutor::BuilderExecutor(char* data,int len)
	{
		_datagram=new PQEngine::GDatagram(data,len);
		_parser=new PQEngine::GDataParser(_datagram);
		_command=_parser->getName();
	}

	BuilderExecutor::~BuilderExecutor()
	{
		delete _datagram;
		delete _parser;
	}


	void BuilderExecutor::exec()
	{
		switch(_command){
			case PQEngine::GDATA_COMMAND_ADD_GPACK_RESOURCE:
				addGPKResource();
				break;
			case PQEngine::GDATA_COMMAND_CREATE_OBJECT:
				createObject();
				break;
			default:
				break;
		}
	}
	


	void BuilderExecutor::addGPKResource()
	{
		std::string path=_parser->getParam()->getString();
		//addGPKResource(path);
	}

	void BuilderExecutor::createObject()
	{
	}


}
